

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <meta name="layout" content="main" />
        <title>Task List</title>
    </head>
    <body>
        <div class="nav">
            <span class="menuButton"><g:link class="create" action="create">New Task</g:link></span>
        </div>
        <div class="body">
            <h1>Task List for ${fieldValue(bean:user, field:'firstname')} (next 24 hours)</h1>

            <div class="list">
                <table cellpadding="1" cellspacing="1" width="50%">
                    <thead>
                        <tr>
                        
                   	        <g:sortableColumn property="id" title="Id" />
                        
                   	        <g:sortableColumn property="name" title="Name" />
                        
                   	        <g:sortableColumn property="date" title="When" />

                   	        <g:sortableColumn property="priority" title="Priority" />
                        
                        </tr>
                    </thead>
                    <tbody>
                    <g:each in="${tasks}" status="i" var="task">
                        <tr class="${(i % 2) == 0 ? 'odd' : 'even'}">
                        
                            <td>${fieldValue(bean:task, field:'id')}</td>
                        
                            <td><g:link action="show" id="${task.id}">${fieldValue(bean:task, field:'name')}</g:link></td>
                        
                            <td>
                                <g:formatDate format="EEE, hh:mm a" date=" ${task.date}"/>

                            </td>

                            <td>${fieldValue(bean:task, field:'priority')}</td>
                        
                        </tr>
                    </g:each>
                    </tbody>
                </table>
            </div>
            <div class="paginateButtons">
                <g:paginate total="${total}"/>
            </div>



        </div>

    <h2>Current time is: <g:formatDate format="EEE, d MMM yyyy h:mm a" date=" ${new Date()}"/></h2>
    
    </body>
</html>
